import '@babel/polyfill'
import React from 'react'
import ReactDOM from 'react-dom'
import { getJSON } from '@sunl-fe/dataservice'
import { URLS } from 'common/config'
import App from 'container/App'

import 'style/less/index.less'

getJSON.initHttpDTO({
    badStatus: [
        {
            status: 401,
            callback() {
                window.location.href = URLS.login
            },
        },
    ],
})

// Render Loading
// ReactDOM.render(
//     <Loading style={{ background: '#fff' }} />,
//     document.getElementById('app'),
// )

// // Render App
// store.dispatch('app.user').then(user => {
//     ReactDOM.render(<App />, document.getElementById('app'))
// })

ReactDOM.render(<App />, document.getElementById('app'))
